xen: Check if the range is valid in init_domheap_pages
authorJulien Grall <julien.grall@linaro.org>
Wed, 13 Nov 2013 13:37:50 +0000 (13:37 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 21 Nov 2013 10:43:01 +0000 (10:43 +0000)
commit45ffa79447954e68892322d985e72620d32ac16d
treea75dc7ac1a85c4943558d7f3be0197de2d383347
parentd77044ccf1fd8dd0adc87cf2c0d77ac26958a7e8
xen: Check if the range is valid in init_domheap_pages

On ARM, when an initrd is given to xen by U-boot, it will reserve the memory
in the device tree.
In this case, when xen decides to free unused memory, dt_unreserved_regions
will call init_domheap_pages with the start and the end of range equals. But
the latter assumes that (start > end), if not Xen will hang because the
number of pages is equals to (unsigned)-1.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Campbell <Ian.campbell@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
xen/common/page_alloc.c